<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.9.1"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>uvgRTP: uvgrtp::session Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">uvgRTP
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.1 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><b>uvgrtp</b></li><li class="navelem"><a class="el" href="classuvgrtp_1_1session.html">session</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="classuvgrtp_1_1session-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">uvgrtp::session Class Reference</div>  </div>
</div><!--header-->
<div class="contents">
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a71aad1226214b1b0b1ba60a46c048ab2"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classuvgrtp_1_1media__stream.html">uvgrtp::media_stream</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classuvgrtp_1_1session.html#a71aad1226214b1b0b1ba60a46c048ab2">create_stream</a> (int src_port, int dst_port, rtp_format_t fmt, int flags)</td></tr>
<tr class="memdesc:a71aad1226214b1b0b1ba60a46c048ab2"><td class="mdescLeft">&#160;</td><td class="mdescRight">Create a bidirectional media stream for an RTP session.  <a href="classuvgrtp_1_1session.html#a71aad1226214b1b0b1ba60a46c048ab2">More...</a><br /></td></tr>
<tr class="separator:a71aad1226214b1b0b1ba60a46c048ab2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a291629a3bfb910463b88d8edb3984149"><td class="memItemLeft" align="right" valign="top">rtp_error_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classuvgrtp_1_1session.html#a291629a3bfb910463b88d8edb3984149">destroy_stream</a> (<a class="el" href="classuvgrtp_1_1media__stream.html">uvgrtp::media_stream</a> *stream)</td></tr>
<tr class="memdesc:a291629a3bfb910463b88d8edb3984149"><td class="mdescLeft">&#160;</td><td class="mdescRight">Destroy a media stream.  <a href="classuvgrtp_1_1session.html#a291629a3bfb910463b88d8edb3984149">More...</a><br /></td></tr>
<tr class="separator:a291629a3bfb910463b88d8edb3984149"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Member Function Documentation</h2>
<a id="a71aad1226214b1b0b1ba60a46c048ab2"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a71aad1226214b1b0b1ba60a46c048ab2">&#9670;&nbsp;</a></span>create_stream()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classuvgrtp_1_1media__stream.html">uvgrtp::media_stream</a>* uvgrtp::session::create_stream </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>src_port</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>dst_port</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">rtp_format_t&#160;</td>
          <td class="paramname"><em>fmt</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>flags</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Create a bidirectional media stream for an RTP session. </p>
<p>If local_addr was provided when <a class="el" href="classuvgrtp_1_1session.html">uvgrtp::session</a> was created, uvgRTP binds itself to local_addr:src_port, otherwise to INADDR_ANY:src_port</p>
<p>This object is used for both sending and receiving media, see documentation for <a class="el" href="classuvgrtp_1_1media__stream.html">uvgrtp::media_stream</a> for more details.</p>
<p>User can enable and disable functionality of uvgRTP by OR'ing RCE_* flags together and passing them using the flags parameter</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">src_port</td><td>Local port that uvgRTP listens to for incoming RTP packets </td></tr>
    <tr><td class="paramname">dst_port</td><td>Remote port where uvgRTP sends RTP packets </td></tr>
    <tr><td class="paramname">fmt</td><td>Format of the media stream. see <a class="el" href="util_8hh.html#a313c6640ac5ed9384184a94ec57a9a96" title="These flags are given to uvgrtp::session::create_stream()">RTP_FORMAT</a> for more details </td></tr>
    <tr><td class="paramname">flags</td><td>RTP context enable flags, see <a class="el" href="util_8hh.html#a15b2d6364db6065a482c99827f4bd2af" title="RTP context enable flags.">RTP_CTX_ENABLE_FLAGS</a> for more details</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>RTP media stream object</dd></dl>
<dl class="retval"><dt>Return values</dt><dd>
  <table class="retval">
    <tr><td class="paramname">uvgrtp::media_stream*</td><td>On success </td></tr>
    <tr><td class="paramname">nullptr</td><td>If src_port or dst_port is 0 </td></tr>
    <tr><td class="paramname">nullptr</td><td>If fmt is not a supported media format </td></tr>
    <tr><td class="paramname">nullptr</td><td>If socket initialization failed </td></tr>
    <tr><td class="paramname">nullptr</td><td>If ZRTP was enabled and it failed to finish handshaking </td></tr>
    <tr><td class="paramname">nullptr</td><td>If RCE_SRTP is given but uvgRTP has not been compiled with Crypto++ enabled </td></tr>
    <tr><td class="paramname">nullptr</td><td>If RCE_SRTP is given but RCE_SRTP_KMNGMNT_* flag is not given </td></tr>
    <tr><td class="paramname">nullptr</td><td>If memory allocation failed </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="a291629a3bfb910463b88d8edb3984149"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a291629a3bfb910463b88d8edb3984149">&#9670;&nbsp;</a></span>destroy_stream()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">rtp_error_t uvgrtp::session::destroy_stream </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classuvgrtp_1_1media__stream.html">uvgrtp::media_stream</a> *&#160;</td>
          <td class="paramname"><em>stream</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Destroy a media stream. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">stream</td><td>Pointer to the media stream that should be destroyed</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>RTP error code</dd></dl>
<dl class="retval"><dt>Return values</dt><dd>
  <table class="retval">
    <tr><td class="paramname">RTP_OK</td><td>On success </td></tr>
    <tr><td class="paramname">RTP_INVALID_VALUE</td><td>If stream is nullptr </td></tr>
    <tr><td class="paramname">RTP_NOT_FOUND</td><td>If stream does not belong to this session </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>include/<a class="el" href="session_8hh_source.html">session.hh</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.1
</small></address>
</body>
</html>
